
/**
 *
 *
 *      opendu  Copyright (C) 2011  YouniS Ben Salah
 *
 *
 *      This file is part of opendu.
 *
 *      opendu is free software: you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation, either version 3 of the License, or
 *      (at your option) any later version.
 *
 *      opendu is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with opendu.  If not, see <http://www.gnu.org/licenses/>.
 *
 *
 *
 *      Program                 ::      opendu
 *      Version                 ::      1.02, beta
 *      Date                    ::      July, August, September, October, November, 2011
 *
 *      Author                  ::      YouniS Ben Salah
 *      E-Mail                  ::      YouniS.BenSalah02@yahoo.de
 *      Website                 ::      http://myhttp.funpic.de
 *
 *      Module                  ::      Main
 *      C File                  ::      main.c
 *      Revision                ::      everything!
 *
 *      ToDo                    ::      + Documentation
 *                                      + Write Help file
 *                                      + Implement SP mode
 *                                      + Implement HighScore feature
 *                                      + License stuff ... (GPL)
 *
 *
 */




#include "yinclude.h"



/*
 *
 *
 *  Function                ::      main()
 *
 *  # Describe main function ...
 *
 *
 */

int main( int argc, char **argv )
{
        /* option entered by user */
    char prompt = '\0';

        /* quit boolean */
    int quit = 1;


        /* spash screen */
    clearScreen();
    write(SPLASH);
    printf("\n\n\n    >>>  press ENTER to continue .. ");
    getchar();

    clearScreen();  /* clearScreen - we clear your screen. */

    write(MENU);  /* show up menu */

    while( quit != QUIT ) {
        write(PROMPT);  /* the >>> cursor */

        prompt = readCh();

        if (        prompt == '1' ) {
            clearScreen();
            while ( play(0) != '2' );    /* modes are not implemented yet. i am lazy ): */
            clearScreen();
            write(MENU);
        }
        else if (   prompt == '2' ) {
            clearScreen();
            write(CREDITS);
        }
        else if (   prompt == '3' ) {
            clearScreen();
            write(HIGHSCORES);
        }
        else if (   prompt == '4' ) {
            clearScreen();
            write(HELP);
        }
        else if (   prompt == '5' ) {
            clearScreen();
            quit = QUIT;
        }
        else if (   prompt == '0' ) {
            clearScreen();
            write(MENU);
        }
        else {
            write(BAD_CMD);  /* menu element doesn't exist */
        }
    }

    write(QUIT);

    return 0;
}




